﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Globalization;

namespace WebHousingInfo.Controls
{
    public partial class Header : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        private void userExit()
        {
            //Disible cookie
            //var userName = new HttpCookie("userName", "") { Expires = DateTime.Now };
            //var passWord = new HttpCookie("passWord", "") { Expires = DateTime.Now };
            //Response.Cookies.Add(userName);
            //Response.Cookies.Add(passWord);

            Session["UserName"] = null;
            Session["PassWord"] = null;
            //txtUserName.Text = string.Empty;
            //txtPassword.Text = string.Empty;
            //Context.Items["Exit"] = "1";
            //Server.Transfer("~/Default.aspx");
        }

        protected void lbtthoat_Click(object sender, EventArgs e)
        {
            userExit();
            Response.Redirect("Home.aspx");
        }

        public string getDatetime()
        {            
            DateTime date = DateTime.Now;
            string ngay = date.ToString("dd/MM/yyyy");
            var list = ngay.Split('/');
            ngay = "Hôm nay, Ngày " + list[0] + " tháng " + list[1] + " năm " + list[2];
            return ngay;
        }
    }
}